<?php
// 应用公共文件

function return_json($code,$message){
    echo json_encode(['code'=>$code,'message'=>$message]);
    exit();
}


function error_404(){
    header("HTTP/1.1 404 Not Found");
    header("Status: 404 Not Found");
    $error_page = <<<EOF
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>404-页面无法找到</title>
    <style>
        .bg {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: url("/static/image/404.jpg") no-repeat;
            background-position: center center;
        }
    </style>
</head>

<body>
    <div class="bg"></div>
</body>

</html>
EOF;
    echo $error_page;
    die();
}